﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using gfPage;
using gfLibrary;
using DBUtility;
using Config;
using Model;
using BLL;

namespace GreatGF
{
    public partial class YQWKCC_LOG_List : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
             gfAjaxJs.SetNoCache();

             if (Page.IsPostBack == false)
             {
                 btnSearch_Click(sender, e);
             }
        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            string strKeywords = txtKeywords.Text;

            string strSql = " SELECT ID, (case CYDJCFS when 1 then '手工录入' else '仪器录入' end) as CYDJCFS, WKCCJCCS, JCLSH, YQCLCC,YQCLCG,YQCLCK,REMARK FROM [RESULT_OVERALLSIZE] where  YQCLCC is not null and YQCLCC<>'' and YQCLCG is not null and YQCLCG<>'' and YQCLCK is not null and YQCLCK<>'' ";

            if (strKeywords.Length > 0)
            {
                strSql += " and JCLSH like '%" + strKeywords + "%'";
            }

            DataTable m_dtTable = new DataTable();
            GreatPager1.BindDataTablePage(ref m_dtTable, AppConfig.g_strConnectionStringSqlClient, strSql, 20);

            rptList.DataSource = m_dtTable;
            rptList.DataBind();

            m_dtTable.Dispose();
        }

        protected void GreatPager1_PageIndexChanging(object sender, gfPage.PagerEventArgs e)
        {
            GreatPager1.PageIndex = e.NewPageIndex;
            btnSearch_Click(sender, null);
         }

        protected void btnSearchAll_Click(object sender, EventArgs e)
        {
            txtKeywords.Text = "";
            btnSearch_Click(sender, e);
        }
    }
}
